﻿@using BonjourQuotation.UI.Models.PartialModel
@model QuotationMiscGridViewModel
@{
    //bool functBtn = true;
    //functBtn = !User.IsInRole("accountant");
}
<div id="VendorContractMisc" style="display:none;">
</div>
@using (Ajax.BeginForm("UpdateQuotationMisc", "Quotation", new AjaxOptions() { HttpMethod = "Post", OnComplete = "QuotaValidateComplete", UpdateTargetId = "tabGrpMisc", InsertionMode = InsertionMode.Replace }, new { enctype = "multipart/form-data", id = "QuotaMiscGridForm" }))
{

   <table class="table table-bordered table-hover">
    <th>#</th>
    <th>Day</th>
    <th>Date</th>
    <th>Vendor</th>
    <th>Flight</th>
    <th>P/Pers</th>
    <th>P/Group</th>
    <th>Curr</th>
    @if (Model.QuotaMiscRemoveBtnView && !(Model.QuotaMiscConfirmed))
    {
        <th>del</th>
    }
    <tbody>
       @if(Model.Rows.Count>0)
        { 
            @Html.HiddenFor(model=>model.Rows[0].QuotaID)
        }
        @for (int ind = 0; ind < Model.Rows.Count; ind++)
{
    <tr class="@(@Model.Rows[ind].CurrencyMisc == "CA" ? "trCurrencyCad" : "") @(@ind % 2 == 0 ? "trRowBackground1" : "")">
        <td class="tdBorderBlack">@Html.LabelForModel(Model.Rows[ind].LineNo)</td>@Html.HiddenFor(model => model.Rows[ind].LineNo)
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].Day, new { @class = "QuotaOnlyDigits QuotaDay QuotaTextBx table_inputs_50 table_inputs_WithoutBox MiscDetTab" })
        </td>
        @if (Model.Rows[ind].LineDate.Contains("Fri") || Model.Rows[ind].LineDate.Contains("Sat"))
        {
            <td class="tdBorderBlack">
                @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date QuotaDatesFriSat" })
            </td>
        }
        else
        {
            <td class="tdBorderBlack">
                @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date" })
            </td>
        }
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].Description, new { @class = "table_inputs_690 table_inputs_WithoutBox MiscDetTab" })
        </td>
        <td class="tdBorderBlack">
            @Html.CheckBoxFor(model => Model.Rows[ind].Plane, new { @class = "MiscDetTab" })
        </td>
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].Cost, new { @class = "QuotaOnlyDecimalDigits table_inputs_Decimal table_inputs_WithoutBox MiscDetTab QuotaMoneyTxb" })
        </td>
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].CostG, new { @class = "QuotaOnlyDecimalDigits table_inputs_Decimal table_inputs_WithoutBox MiscDetTab QuotaMoneyTxb" })
        </td>
        <td class="tdBorderBlack">
            @if (Model.Rows[ind].CurrencyMisc == "CA")
            { 
                @Html.TextBoxFor(model => Model.Rows[ind].CurrencyMisc, new { @class = "QuotaTextBx CurrencyMisc table_inputs_50 table_inputs_WithoutBox MiscDetTab QuotationCurrCAD" })
            }
            else
            {
                @Html.TextBoxFor(model => Model.Rows[ind].CurrencyMisc, new { @class = "QuotaTextBx CurrencyMisc table_inputs_50 table_inputs_WithoutBox MiscDetTab" })
            }
        </td>
        @if (Model.QuotaMiscRemoveBtnView && !(Model.QuotaMiscConfirmed))
        { 
            <td><button class="btndel" style="padding:0px;" type="button" onclick="RemoveMisc('@Model.Rows[ind].MiscID','@Model.Rows[ind].LineNo')"></button></td>
        }
    </tr>
}
    </tbody>
</table>
    if (Model.QuotaMiscInsertBtnView && !(Model.QuotaMiscConfirmed))
    {
        <input type="number" class="QuotaTabInsertTxb" id="MiscInsertLine" min="1" value="1" />
        <button class="btn14" type="button" onclick="InsertLineMiscGrid()">Insert</button>
    }
    <div class="pull-right QuotaTabUpdateDivBtn">
        @if (Model.QuotaMiscNewLineBtnView && !(Model.QuotaMiscConfirmed))
        { 
            <button class="btn14" type="button" onclick="MiscNewLine()">New Line</button>
        }
        @if (Model.QuotaMiscUpdateBtnView && !(Model.QuotaMiscConfirmed))
        { 
            <button class="btn14" id="MiscTabUpdate" type="submit">Validate</button>
        }
    </div>
<div class="row form-row">
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important; margin-left: 30px;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.PPSum)</span>
            @Html.LabelForModel(Model.PPSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.PGSum)</span>
            @Html.LabelForModel(Model.PGSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.TotalPPSum)</span>
            @Html.LabelForModel(Model.TotalPPSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.TotalPGSum)</span>
            @Html.LabelForModel(Model.TotalPGSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
</div>
}
        
  


